<?php

class Application_Model_Difficolta extends Zend_Db_Table_Row_Abstract
{
    function __get($key) 
    {
        if (method_exists($this, $key)) {
            return $this->$key();
        }
        return parent::__get($key);
    }
    
    public function descrizioneCompleta()
    {
        $ident = $this->diffIdent;
        $nome = $this->diffNome;
        $descrizione = $this->diffDescrizione;
        
        // Setup difficoltà icon
        switch ($ident) {
            case "T" :
                $ico = '<img src="/img/difficolta/diff_T.jpg" />';
                break;
            case "E" :
                $ico = '<img src="/img/difficolta/diff_E.jpg" />';
                break;
            case "EE" :
                $ico = '<img src="/img/difficolta/diff_EE.jpg" />';
                break;
            case "EEA" :
                $ico = '<img src="/img/difficolta/diff_EEA.jpg" />';
                break;
            case "EAI" :
                $ico = '<img src="/img/difficolta/diff_EAI.jpg" />';
                break;
            default :
                $ico = '<img src="/img/difficolta/diff_T.jpg" />';
                break;
        }
        
        $html = $ico;
        $html .= '<p><strong>';
        $html .= $ident;
        $html .= '</strong> :';
        $html .= $nome;
        $html .= ' [<span class="small">';
        $html .= $descrizione;
        $html .= '</span>]';
        return $html;
    }
}

